package Text_58;

public class Code {

	public static void main(String[] args) {
		 int[] gain = {5,1,-5,0,-7};

         int ans = 0, sum = 0;
         for (int x : gain) {
             sum += x;
             ans = Math.max(ans, sum);
         }
         for (int i = 0; i <gain.length ; i++) {
        	 System.out.print(gain[i]+" ");
         }

	}

}
